﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TTTTBHYT
{
    public partial class frmSetting : Form
    {
        public frmSetting()
        {
            InitializeComponent();
        }

        private void frmSetting_Load(object sender, EventArgs e)
        {
            flxSetting.Rows[1][1] = "Giám định";
            flxSetting.Rows[2][1] = "Kế toán trưởng";
            flxSetting.Rows[3][1] = "Giám đốc";
            flxSetting.Rows[4][1] = "Nội trú mức 1";
            flxSetting.Rows[5][1] = "Nội trú mức 2";
            flxSetting.Rows[6][1] = "Nội trú mức 3";
            flxSetting.Rows[7][1] = "Ngoại trú mức 1";
            flxSetting.Rows[8][1] = "Ngoại trú mức 2";
            flxSetting.Rows[9][1] = "Ngoại trú mức 3";
            flxSetting.Rows[10][1] = "Tự chọn nước ngoài";
            flxSetting.Rows[11][1] = "Mức min";
          
            flxSetting.Rows[1][2] = global::TTTTBHYT.Properties.Settings.Default.Giamdinh;
            flxSetting.Rows[2][2] = global::TTTTBHYT.Properties.Settings.Default.Ketoantruong;
            flxSetting.Rows[3][2] = global::TTTTBHYT.Properties.Settings.Default.Giamdoc;
            flxSetting.Rows[4][2] = global::TTTTBHYT.Properties.Settings.Default.Noitrumuc1;
            flxSetting.Rows[5][2] = global::TTTTBHYT.Properties.Settings.Default.Noitrumuc2;
            flxSetting.Rows[6][2] = global::TTTTBHYT.Properties.Settings.Default.Noitrumuc3;
            flxSetting.Rows[7][2] = global::TTTTBHYT.Properties.Settings.Default.ngoaitrumuc1;
            flxSetting.Rows[8][2] = global::TTTTBHYT.Properties.Settings.Default.ngoaitrumuc2;
            flxSetting.Rows[9][2] = global::TTTTBHYT.Properties.Settings.Default.ngoaitrumuc3;
            flxSetting.Rows[10][2] = global::TTTTBHYT.Properties.Settings.Default.tuchonnuocngoai;
            flxSetting.Rows[11][2] = global::TTTTBHYT.Properties.Settings.Default.mucmin;
          
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
           global::TTTTBHYT.Properties.Settings.Default.Giamdinh  = flxSetting.Rows[1][2].ToString();
           global::TTTTBHYT.Properties.Settings.Default.Ketoantruong= flxSetting.Rows[2][2].ToString();
           global::TTTTBHYT.Properties.Settings.Default.Giamdoc = flxSetting.Rows[3][2].ToString();
           global::TTTTBHYT.Properties.Settings.Default.Noitrumuc1 = Convert.ToInt32(flxSetting.Rows[4][2]);
           global::TTTTBHYT.Properties.Settings.Default.Noitrumuc2 = Convert.ToInt32(flxSetting.Rows[5][2]);
           global::TTTTBHYT.Properties.Settings.Default.Noitrumuc3  = Convert.ToInt32(flxSetting.Rows[6][2]);
           global::TTTTBHYT.Properties.Settings.Default.ngoaitrumuc1  = Convert.ToInt32(flxSetting.Rows[7][2]);
           global::TTTTBHYT.Properties.Settings.Default.ngoaitrumuc2= Convert.ToInt32(flxSetting.Rows[8][2]);
           global::TTTTBHYT.Properties.Settings.Default.ngoaitrumuc3 = Convert.ToInt32(flxSetting.Rows[9][2]);
           global::TTTTBHYT.Properties.Settings.Default.tuchonnuocngoai = Convert.ToInt32(flxSetting.Rows[10][2]);
           global::TTTTBHYT.Properties.Settings.Default.mucmin = Convert.ToInt32(flxSetting.Rows[11][2]);

           global::TTTTBHYT.Properties.Settings.Default.Save();
           this.Close();
        }
    }
}
